Enum isotope_parser::prettyprint::Doc[]

pub enum Doc<'a, T, A = ()> where
    T: DocPtr<'a, A>, 
{
Show variants Nil, Append(T, T), Group(T), FlatAlt(T, T), Nest(isize, T), Line, OwnedText(Box<str, Global>), BorrowedText(&'a str), SmallText(ArrayString<[u8; 22]>), Annotated(A, T), Union(T, T), Column(<T as DocPtr<'a, A>>::ColumnFn), Nesting(<T as DocPtr<'a, A>>::ColumnFn), Fail,
}
Expand description

The concrete document type. This type is not meant to be used directly. Instead use the static functions on Doc or the methods on an DocAllocator.

The T parameter is used to abstract over pointers to Doc. See RefDoc and BoxDoc for how it is used

Variants

Nil
Append(T, T)
Group(T)
FlatAlt(T, T)
Nest(isize, T)
Line
OwnedText(Box<str, Global>)
BorrowedText(&'a str)
SmallText(ArrayString<[u8; 22]>)
Annotated(A, T)
Union(T, T)
Column(<T as DocPtr<'a, A>>::ColumnFn)
Nesting(<T as DocPtr<'a, A>>::ColumnFn)
Fail

Implementations

Writes a rendered document to a std::io::Write object.

Writes a rendered document to a std::fmt::Write object.

Writes a rendered document to a RenderAnnotated<A> object.

Returns a value which implements std::fmt::Display

use pretty::{Doc, BoxDoc};
let doc = BoxDoc::<()>::group(
    BoxDoc::text("hello").append(Doc::line()).append(Doc::text("world"))
);
assert_eq!(format!("{}", doc.pretty(80)), "hello world");

An empty document.

The text t.to_string().

The given text must not contain line breaks.

A single hardline.

The given text, which must not contain line breaks.

A line acts like a \n but behaves like space if it is grouped on a single line.

Acts like line but behaves like nil if grouped on a single line

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.